//
//  InnerWebViewController.m
//  Unity-iPhone
//
//  Created by Karl on 2017/3/28.
//
//

#import "InnerWebViewController.h"


@interface InnerWebViewController ()

@end

@implementation InnerWebViewController{
    NSString *_url;
    UIWebView *_webView;
}

- (instancetype)initWithUrl:(NSString *)url{
    self=  [super init];
    if (self) {
        _url = url;
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor  =[UIColor whiteColor];
    
    UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithTitle:Babel(@"back") style:UIBarButtonItemStylePlain target:self action:@selector(backAction:)];
    [self.navigationItem setLeftBarButtonItem:back];
    
    
    
    _webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:_webView];
    
    [_webView loadRequest:[[NSURLRequest alloc] initWithURL:[NSURL URLWithString:_url]]];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)backAction:(id)sender{
    [self dismissViewControllerAnimated:YES completion:nil];
}

@end
